package com.ruoyi.stuinfo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.stuinfo.mapper.EduCommunicationMapper;
import com.ruoyi.stuinfo.domain.EduCommunication;
import com.ruoyi.stuinfo.service.IEduCommunicationService;

/**
 * 沟通记录Service业务层处理
 *
 * @author zc
 * @date 2025-05-15
 */
@Service
public class EduCommunicationServiceImpl implements IEduCommunicationService
{
    @Autowired
    private EduCommunicationMapper eduCommunicationMapper;

    /**
     * 查询沟通记录
     *
     * @param id 沟通记录主键
     * @return 沟通记录
     */
    @Override
    public EduCommunication selectEduCommunicationById(Long id)
    {
        return eduCommunicationMapper.selectEduCommunicationById(id);
    }

    /**
     * 查询沟通记录列表
     *
     * @param eduCommunication 沟通记录
     * @return 沟通记录
     */
    @Override
    public List<EduCommunication> selectEduCommunicationList(EduCommunication eduCommunication)
    {
        return eduCommunicationMapper.selectEduCommunicationList(eduCommunication);
    }

    /**
     * 新增沟通记录
     *
     * @param eduCommunication 沟通记录
     * @return 结果
     */
    @Override
    public int insertEduCommunication(EduCommunication eduCommunication)
    {
        eduCommunication.setCreateTime(DateUtils.getNowDate());
        return eduCommunicationMapper.insertEduCommunication(eduCommunication);
    }

    /**
     * 修改沟通记录
     *
     * @param eduCommunication 沟通记录
     * @return 结果
     */
    @Override
    public int updateEduCommunication(EduCommunication eduCommunication)
    {
        eduCommunication.setUpdateTime(DateUtils.getNowDate());
        return eduCommunicationMapper.updateEduCommunication(eduCommunication);
    }

    /**
     * 批量删除沟通记录
     *
     * @param ids 需要删除的沟通记录主键
     * @return 结果
     */
    @Override
    public int deleteEduCommunicationByIds(Long[] ids)
    {
        return eduCommunicationMapper.deleteEduCommunicationByIds(ids);
    }

    /**
     * 删除沟通记录信息
     *
     * @param id 沟通记录主键
     * @return 结果
     */
    @Override
    public int deleteEduCommunicationById(Long id)
    {
        return eduCommunicationMapper.deleteEduCommunicationById(id);
    }

    @Override
    public List<EduCommunication> selectEduCommunicationList_handteacher(String teacherId) {
        return eduCommunicationMapper.selectEduCommunicationList_handteacher(teacherId);
    }
}
